$(function () {
    var id = getQueryString("id");
    vm.getInfo(id);
});

var vm = new Vue({
    el:'#mapp',
    data:{
        controllerUrl: ajaxServerUrlG() + "bsnstudent/",
        title: "儿童详情信息",
        bsnStudent: {},
    },
    methods:{
        getInfo: function(id){
            console.log(StringUtils.isEmpty(id));

            if (StringUtils.isEmpty(id)) return;
            var thisUrl = ajaxServerUrlG("bsnstudent/info/" + id);
            $.get(thisUrl, function(r){
                if(r.code === 0){
                    vm.bsnStudent = r.bsnStudent;
                }else{
                    alert(r.msg);
                }
            });
        }
    },
    filters: {
        /*过滤并替换头像 */
        imgFilter: function (imgUrl, xingb) {
            // console.log(imgUrl);
            if (StringUtils.isNotEmpty(imgUrl)) {
                return imgUrl;
            }
            if (xingb == "男") {
                return "images/man@2x.png";
            } else {
                return "images/woman@2x.png";
            }
        }
    }
});


